/*================================================================
*   Copyright (C) 2020 Sangfor Ltd. All rights reserved.
*   
*   文件名称：while_open_file.c
*   创 建 者：Ann
*   创建日期：2020年05月07日
*   描    述：
*
================================================================*/

#include <stdio.h>
#include <unistd.h>

int main()
{
    int count = 0;
    while(1)
    {
        FILE* fp = fopen("tmp.file", "w+");
        if(!fp)
        {
            break;
        }
        count++;
    }
    printf("Sum open file counts is %d\n", count);
    while(1)
    {
        sleep(1);
    }
    return 0;
}
